using System.Collections.Generic;

using lucere.io;

namespace lucere.index.diagnostic
{
    /// <summary>
    /// Returned from CheckIndex() detailing the health and status of the index.
    /// </summary>
    public interface IStatus 
    {
        /// <summary>
        /// True if no problems were found with the index. 
        /// </summary>
        bool IsClean { get; set; } 
        /// <summary>
        /// True if we were unable to locate and load the segments_N file. 
        /// </summary>
        bool IsMissingSegments { get; set; } 
        /// <summary>
        /// True if we were unable to open the segments_N file.
        /// </summary>
        bool OpenSegmentsFailed { get; set; } 
        /// <summary>
        /// True if we were unable to read the version number from segments_N file.
        /// </summary>
        bool SegmentVersionMissing { get; set; } 
        /// <summary>
        /// Name of latest segments_N file in the index. 
        /// </summary>
        string SegmentsFileName { get; set; } 
        /// <summary>
        /// Number of segments in the index.
        /// </summary>
        int SegmentCount { get; set; } 
        /// <summary>
        /// String description of the version of the index.
        /// </summary>
        string SegmentFormat { get; set; } 
        /// <summary>
        /// Empty unless you passed specific segments list to check as optional 3rd argument.
        /// </summary>
        IList<string> CheckedSegments { get; set; } 
        /// <summary>
        /// True if the index was created with a newer version of Lucene than the CheckIndex tool. 
        /// </summary>
        bool IsToolOutOfDate { get; set; }
        /// <summary>
        /// List of ISegmentInfoStatus instances, detailing status of each segment.
        /// </summary>
        IList<ISegmentInfoStatus> SegmentInfos { get; set; } 
        /// <summary>
        /// Directory index is in.
        /// </summary>
        IDirectory Directory { get; set; } 

        /// <summary>
        /// SegmentInfos instance containing only segments that had no problems 
        /// (this is used with the FixIndex method to repair the index. 
        /// </summary>
        ISegmentInfos NewSegments { get; set; } 

        /// <summary>
        /// How many documents will be lost to bad segments.
        /// </summary>
        int TotalLostDocumentCount { get; set; } 

        /// <summary>
        /// How many bad segments were found.
        /// </summary>
        int BadSegmentCount { get; set; } 
      
        /// <summary>
        /// True if we checked only specific segments CheckIndex(List) 
        /// was called with non-null argument.
        /// </summary>
        bool IsPartial { get; set; } 
        
        /// <summary>
        /// Holds the userData of the last commit in the index
        /// </summary>
        IDictionary<string, string> UserData { get; set; } 
    }
}